package com.qinggeng.project.api.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qinggeng.common.enums.MessageTypeEnum;
import com.qinggeng.common.utils.DateUtils;
import com.qinggeng.project.system.domain.UserMessage;
import lombok.Data;

import java.util.Date;

/**
 * @author 吴鹏飞
 * @date 2020/9/8
 */
@Data
public class MessageListDto {
    //消息Id
    private Long messageId;
    //消息标题
    private String messageTitle;
    //消息内容
    private String messageContent;
    //消息图标
    private String messageIcon;
    //活动图片
    private String messageImage;

    @JsonIgnore
    private Long fkId;

    //订单号
    private Long orderId;

    //跳转Url
    private String messageUrl;

    //消息类型
    private String messageType;

    //活动类型判断 0=是 1=不是
    private String isActivity;

    //消息或活动创建时间
    private String messageTime;

    private Long orderGoodsId;

    public MessageListDto() {
    }

    public void setMessageType(String messageType) {
        this.messageType = messageType;
    }

    public Long getOrderId() {
        if(this.messageType.equals(MessageTypeEnum.订单消息.getValue())){
            return this.fkId;
        }
        return null;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getOrderGoodsId() {
        if(this.messageType.equals(MessageTypeEnum.退款消息.getValue())){
            return this.fkId;
        }
        return null;
    }

    public void setOrderGoodsId(Long orderGoodsId) {
        this.orderGoodsId = orderGoodsId;
    }
}
